#取款机系统
#定义存放学生信息列表
card={'money':1000,'pwd':123456}

#信息输出函数
def showMoney():
    print("余额            ")
    print(card['money'])
print("="*12,"取款机系统","="*14)
print("="*12,"  请插卡  ","="*14)
password=input("请输入密码")

if int(password)==card['pwd']:
    while True:
        print("{0:1} {1:13} {2:15}".format(" ","1.查看余额","2.修改密码"))
        print("{0:1} {1:13} {2:15}".format(" ","3.取款","4.退出系统"))
        print("="*40)
        key = input("请输入对应选项")
        if key == "1":
            print("="*12,"查看余额","="*14)
            showMoney()
            input("按回车键继续：")
        elif key=="2":
            print("=" * 12, "修改密码", "=" * 14)
            newpwd= input("请输入新密码：")
            card['pwd']=newpwd
            print("新密码修改成功",card['pwd'])
            input("按回车键继续：")
        elif key=="3":
            print("=" * 12, "取款", "=" * 14)
            out=input("请输入取多少")
            card['money']=card['money']-int(out)
            showMoney()
            input("按回车键继续：")
        elif key=="4":
            print("=" * 12, "退出系统", "=" * 14)
            break
        else:
            print("============无效输入============")
else:
    print("="*12,"密码错误","="*14)
    # key = input("请输入对应选项")
    # if key=="1":
    #     print("="*12,"查看余额","="*14)
    #     showStu(stulist)
    #     input("按回车键继续：")
    # elif key=="2":
    #     print("=" * 12, "修改密码", "=" * 14)
    #     stu={}
    #     stu['name']=input("请输入添加的姓名")
    #     stu['age']=input("请输入添加的年龄")
    #     stu['classid']=input("请输入添加的课程")
    #     stulist.append(stu)
    #     showStu(stulist)
    #     input("按回车键继续：")
    # elif key=="3":
    #     print("=" * 12, "转账", "=" * 14)
    #     showStu(stulist)
    #     did=input("请输入要删除的id号")
    #     del stulist[int(did)-1]
    #     showStu(stulist)
    #     input("按回车键继续：")
    # elif key=="4":
    #     print("=" * 12, "退出系统", "=" * 14)
    #     break
    # else:
    #     print("============无效输入============")